package com.lagou.demo.controller;

import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.LagouSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@LagouController
@LagouRequestMapping("/security")
@LagouSecurity(value = {"user6"})
public class SecurityController {



    @LagouRequestMapping("/security1")
    @LagouSecurity(value = {"user1","user2"})
    public String security1(HttpServletRequest request, HttpServletResponse response, String name) throws IOException {
        response.getWriter().write("security1 success");
        return null;
    }


    @LagouRequestMapping("/security2")
    @LagouSecurity(value = {"user2","user3"})
    public String security2(HttpServletRequest request, HttpServletResponse response, String name) throws IOException {
        response.getWriter().write("security2 success");
        return null;
    }


    @LagouRequestMapping("/security3")
    @LagouSecurity(value = {"user3","user4"})
    public String security3(HttpServletRequest request, HttpServletResponse response, String name) throws IOException {
        response.getWriter().write("security3 success");
        return null;
    }


    @LagouRequestMapping("/security4")
    @LagouSecurity(value = {"user4","user5"})
    public String security4(HttpServletRequest request, HttpServletResponse response, String name) throws IOException {
        response.getWriter().write("security4 success");
        return null;
    }

    @LagouRequestMapping("/security5")
    @LagouSecurity(value = {"user5","user6"})
    public String security5(HttpServletRequest request, HttpServletResponse response, String name) throws IOException {
        response.getWriter().write("security5 success");
        return null;
    }


}
